package com.lecture.java8.time;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * @program: spring-lecture
 * @description:
 * @author: luyn
 * @create: 2020-03-31 20:58
 **/
public class LocalDateTimeTest {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.now();
        System.out.println(localDateTime);

        BigDecimal b = new BigDecimal(0.1f);
        System.out.println(b);
        BigDecimal c = new BigDecimal("0.6");
        BigDecimal d = new BigDecimal("0.2");
        System.out.println(c);
        System.out.println(c.subtract(d));
        Double e = 0.6d;
        Double f = 0.2d;
        System.out.println(e - f);
        String str = "a,b,c,,";
        String[] ary = str.split(",");
// 预期大于 3，结果是 3
        System.out.println(ary.length);
        System.out.println("-------");

        String[] strA = new String[] { "yang", "hao" };
        List list = Arrays.asList(strA);

        List<String> removeList = new ArrayList<>();
        removeList.add("1");
        removeList.add("2");
        removeList.removeIf("2"::equals);
        removeList.forEach(System.out::println);
        /*for (String item : removeList) {
            if ("1".equals(item)) {
                list.remove(item);
            }
        }
        for (String item : removeList) {
            System.out.println(item);
        }*/

        //removeList.forEach(System.out::println);

    }
}
